import random

from wish.pool.bh3_pet_pool import BH3PetPool


def once_need_times():
    times = 0
    first = False
    fs = 0

    pool = BH3PetPool()
    while True:
        times += 1
        if times >= 300:
            return times

        t = pool.next()

        if t == BH3PetPool.PET:
            if not first:
                first = True
            else:
                fs += 105
        if t == BH3PetPool.FRE:
            fs += random.randint(2, 4)

        if not first and fs >= 150:
            first = True
            fs -= 150

        if first and fs >= 250:
            return times
